// const crypto =  require("crypto")//对称加密
// const key = Buffer.from("tklcpf0b0mm0qnao");
// const iv =  Buffer.from("06n6lt98s9svja1g");
const random = Math.floor(1+Math.random()*100);
const random2 = Math.floor(1+Math.random()*8);
exports.encrypto=function(str){
        // const cry = crypto.createCipheriv("aes-128-cbc",key,iv);
        // let result = cry.update(str,'utf-8',"hex");
        //  result +=  cry.final("hex");
        const heade = Math.random().toString(32).slice(-random2)+Math.random().toString(32).slice(-random2);
        const lest  = Math.random().toString(32).slice(-random2)+Math.random().toString(32).slice(-random2);
        const  meddle = str*random
        const result = heade+meddle+lest;
       return result;
    }
exports.decrypto = function(str){
    let result =str.substr(random * 2);
     result = result.substr(0,(result.length)-random2*2);
    // const decry = crypto.createCipheriv("aes-128-cbc",key,iv);
    // let result = decry.update(str,"hex","utf-8");
    // result +=decry.final("utf8");
    return result/random;
}